package com.zjt.entity.product;

/**
 * Created with IntelliJ IDEA.
 * User: xueyanbeijing
 * Date: 12-8-24
 * Time: AM5:29
 * 产品二维码信息表，与产品关联
 * To change this template use File | Settings | File Templates.
 */

import com.zjt.entity.BaseEntity;
import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;

import javax.persistence.Entity;
import javax.persistence.Table;

@Entity
//表名与类名不相同时重新定义表名.
@Table(name="s_qr_code")
//默认的缓存策略.
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
public class QrCode extends BaseEntity {
    private String codeValue;  //二级码实际值
    private String codeType;//二维码类型
    private String description;//说明，二维码规则
    private long productId;//关联产品ID

    private Integer total;//扫描次数；0,1  0,1如果为0，则说明该二维码未被扫描，1，则为已扫描，不能再扫描，客户显示上次扫描结果
    private int hasToPng;//是否生成二级码图片 0，1s

    public int getHasToPng() {
        return hasToPng;
    }

    public void setHasToPng(int hasToPng) {
        this.hasToPng = hasToPng;
    }

    public Integer getTotal() {
        return total;
    }

    public void setTotal(Integer total) {
        this.total = total;
    }

    public String getCodeValue() {
        return codeValue;
    }

    public void setCodeValue(String codeValue) {
        this.codeValue = codeValue;
    }

    public String getCodeType() {
        return codeType;
    }

    public void setCodeType(String codeType) {
        this.codeType = codeType;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public long getProductId() {
        return productId;
    }

    public void setProductId(long productId) {
        this.productId = productId;
    }

    @Override
    public String toString() {
        return "QrCode{" +
                "codeValue='" + codeValue + '\'' +
                ", codeType='" + codeType + '\'' +
                ", description='" + description + '\'' +
                ", productId=" + productId +
                ", total=" + total +
                ", hasToPng=" + hasToPng +
                '}';
    }
}
